package com.longge;

import java.util.Arrays;

public class MinNumber {

    public int minNumber(int[] nums1, int[] nums2) {

        Arrays.sort(nums1);
        Arrays.sort(nums2);
        for (int i : nums1) {
            for (int j : nums2) {
                if (i==j) return i;
            }
        }
        if (nums1[0]>nums2[0]){
            return Integer.parseInt(nums2[0]+""+nums1[0]);

        }else {
            return Integer.parseInt(nums1[0]+""+nums2[0]);

        }


    }
}
